<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

use Monolog\Handler\StreamHandler;
use Monolog\Logger;



class MyLog extends Model
{
	/*
	自定义日志
	 */
    public function setLog($data,$logPath){

        $logfilename=date('Y-m-d');
        $log = new Logger('register');
        $log->pushHandler(new StreamHandler(storage_path().'/logs/'.$logPath.'/'.$logfilename.'.log'),Logger::INFO);
        $log->addInfo($data);
    }
}
